﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Markup;
using System.Windows;
using SDF.Primitives;

namespace SDF
{
    [WhitespaceSignificantCollection]
    [ContentWrapper(typeof(TextRun))]
    public class SmartInlineCollection : LogicalChildrenCollection<SmartInline>
    {
        public SmartInlineCollection(DependencyObject container)
            : base(container)
        {
        }

        protected override SmartInline Convert(object value)
        {
            var text = value as String;
            if (text != null)
                return new TextRun(text);

            return base.Convert(value);
        }
    }
}
